const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('station_info', {
    location: {
      type: DataTypes.STRING(100),
      allowNull: false,
      primaryKey: true,
      comment: "位置"
    },
    power: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "功率"
    },
    total: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "充电枪总数"
    },
    fault: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "故障充电枪"
    },
    normal: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "正常充电枪"
    }
  }, {
    sequelize,
    tableName: 'station_info',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "location" },
        ]
      },
    ]
  });
};
